<?php 
    $module = $this->uri->segment(1);
    foreach($car_list as $row)
    { 
?>
        <div  class= "modelItem">
            <img width="112px" height="84px" src="<?php echo base_url()?>system/public/assets/cars/<?php echo $row->image ?>" />
            <span class="msrpRange">
<?php 
            if(strtoupper($module) != 'RENT') {
                echo "$" . number_format($row->car_price, 0);
            }
?>
            </span> 
            <p class="configLink">
<?php 
                echo anchor(
                    "index.php/" . $module . "/detail/" . $row->id, 
                    $row->car_serie . " " . $row->car_make . " " . $row->car_model);
?>
            </p>
            <div class="mpgRange">
<?php 
                echo "Car category: " . $row->car_category;
                echo ", Type: " . $row->car_type;
                echo ", External color: " . $row->external_color;
                echo ", Internal color: " . $row->internal_color;
                echo ", Door: " . $row->door_count;
                echo ", Drivetrain: " . $row->drivetrain;
                echo ", Transmission: " . $row->transmission;

                $car_fuel = '';
                if(strlen($row->fuel) != 0) {
                    $fuel_list = preg_split('/,/', $row->fuel, -1, PREG_SPLIT_OFFSET_CAPTURE);
                    foreach($fuel_list as $fuel)
                    {
                        $this->db->limit(1);
                        $query = $this->db->get_where("psacar_fuel", array("id" => $fuel[0]));
                        if(strlen($car_fuel) != 0)
                            $car_fuel .= ', ';

                        $car_fuel .= $query->row()->fuel;
                    }                    
                }                
                echo ", Fuel: " . $car_fuel;            
?>
            </div> 
            <div class="mpgRange">
<?php 
                echo 
                    "<br><strong>Dealer: </strong>" . 
                    anchor(
                        "index.php/member/detail/" . $row->dealer_id, 
                        $row->dealer_name,
                        array('class' => 'blue'));
                echo ", " . $row->company_phone_1 . ", " . $row->email;
?>
            </div>
        </div>
<?php
    }
?>            